package de.duester.genealogy.model.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import de.duester.genealogy.model.Person;
import de.duester.genealogy.model.EventCode;
import de.duester.genealogy.model.Event;
import de.duester.genealogy.model.EventAttribute;
import de.duester.genealogy.model.Document;
import de.duester.genealogy.model.PlaceCode;
import de.duester.genealogy.model.Place;
import de.duester.genealogy.model.Date;
import de.duester.genealogy.model.RoleCode;
import de.duester.genealogy.model.PersonRoleCode;
import de.duester.genealogy.model.PersonEvent;
import de.duester.genealogy.model.PersonDocument;
import de.duester.genealogy.model.EventDocument;
import de.duester.genealogy.model.EventPlace;
import de.duester.genealogy.model.EventDate;
import de.duester.genealogy.model.EventString;
import de.duester.genealogy.model.DocumentPlace;

import de.duester.genealogy.model.dao.PersonDao;
import de.duester.genealogy.model.dao.EventCodeDao;
import de.duester.genealogy.model.dao.EventDao;
import de.duester.genealogy.model.dao.EventAttributeDao;
import de.duester.genealogy.model.dao.DocumentDao;
import de.duester.genealogy.model.dao.PlaceCodeDao;
import de.duester.genealogy.model.dao.PlaceDao;
import de.duester.genealogy.model.dao.DateDao;
import de.duester.genealogy.model.dao.RoleCodeDao;
import de.duester.genealogy.model.dao.PersonRoleCodeDao;
import de.duester.genealogy.model.dao.PersonEventDao;
import de.duester.genealogy.model.dao.PersonDocumentDao;
import de.duester.genealogy.model.dao.EventDocumentDao;
import de.duester.genealogy.model.dao.EventPlaceDao;
import de.duester.genealogy.model.dao.EventDateDao;
import de.duester.genealogy.model.dao.EventStringDao;
import de.duester.genealogy.model.dao.DocumentPlaceDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig personDaoConfig;
    private final DaoConfig eventCodeDaoConfig;
    private final DaoConfig eventDaoConfig;
    private final DaoConfig eventAttributeDaoConfig;
    private final DaoConfig documentDaoConfig;
    private final DaoConfig placeCodeDaoConfig;
    private final DaoConfig placeDaoConfig;
    private final DaoConfig dateDaoConfig;
    private final DaoConfig roleCodeDaoConfig;
    private final DaoConfig personRoleCodeDaoConfig;
    private final DaoConfig personEventDaoConfig;
    private final DaoConfig personDocumentDaoConfig;
    private final DaoConfig eventDocumentDaoConfig;
    private final DaoConfig eventPlaceDaoConfig;
    private final DaoConfig eventDateDaoConfig;
    private final DaoConfig eventStringDaoConfig;
    private final DaoConfig documentPlaceDaoConfig;

    private final PersonDao personDao;
    private final EventCodeDao eventCodeDao;
    private final EventDao eventDao;
    private final EventAttributeDao eventAttributeDao;
    private final DocumentDao documentDao;
    private final PlaceCodeDao placeCodeDao;
    private final PlaceDao placeDao;
    private final DateDao dateDao;
    private final RoleCodeDao roleCodeDao;
    private final PersonRoleCodeDao personRoleCodeDao;
    private final PersonEventDao personEventDao;
    private final PersonDocumentDao personDocumentDao;
    private final EventDocumentDao eventDocumentDao;
    private final EventPlaceDao eventPlaceDao;
    private final EventDateDao eventDateDao;
    private final EventStringDao eventStringDao;
    private final DocumentPlaceDao documentPlaceDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        personDaoConfig = daoConfigMap.get(PersonDao.class).clone();
        personDaoConfig.initIdentityScope(type);

        eventCodeDaoConfig = daoConfigMap.get(EventCodeDao.class).clone();
        eventCodeDaoConfig.initIdentityScope(type);

        eventDaoConfig = daoConfigMap.get(EventDao.class).clone();
        eventDaoConfig.initIdentityScope(type);

        eventAttributeDaoConfig = daoConfigMap.get(EventAttributeDao.class).clone();
        eventAttributeDaoConfig.initIdentityScope(type);

        documentDaoConfig = daoConfigMap.get(DocumentDao.class).clone();
        documentDaoConfig.initIdentityScope(type);

        placeCodeDaoConfig = daoConfigMap.get(PlaceCodeDao.class).clone();
        placeCodeDaoConfig.initIdentityScope(type);

        placeDaoConfig = daoConfigMap.get(PlaceDao.class).clone();
        placeDaoConfig.initIdentityScope(type);

        dateDaoConfig = daoConfigMap.get(DateDao.class).clone();
        dateDaoConfig.initIdentityScope(type);

        roleCodeDaoConfig = daoConfigMap.get(RoleCodeDao.class).clone();
        roleCodeDaoConfig.initIdentityScope(type);

        personRoleCodeDaoConfig = daoConfigMap.get(PersonRoleCodeDao.class).clone();
        personRoleCodeDaoConfig.initIdentityScope(type);

        personEventDaoConfig = daoConfigMap.get(PersonEventDao.class).clone();
        personEventDaoConfig.initIdentityScope(type);

        personDocumentDaoConfig = daoConfigMap.get(PersonDocumentDao.class).clone();
        personDocumentDaoConfig.initIdentityScope(type);

        eventDocumentDaoConfig = daoConfigMap.get(EventDocumentDao.class).clone();
        eventDocumentDaoConfig.initIdentityScope(type);

        eventPlaceDaoConfig = daoConfigMap.get(EventPlaceDao.class).clone();
        eventPlaceDaoConfig.initIdentityScope(type);

        eventDateDaoConfig = daoConfigMap.get(EventDateDao.class).clone();
        eventDateDaoConfig.initIdentityScope(type);

        eventStringDaoConfig = daoConfigMap.get(EventStringDao.class).clone();
        eventStringDaoConfig.initIdentityScope(type);

        documentPlaceDaoConfig = daoConfigMap.get(DocumentPlaceDao.class).clone();
        documentPlaceDaoConfig.initIdentityScope(type);

        personDao = new PersonDao(personDaoConfig, this);
        eventCodeDao = new EventCodeDao(eventCodeDaoConfig, this);
        eventDao = new EventDao(eventDaoConfig, this);
        eventAttributeDao = new EventAttributeDao(eventAttributeDaoConfig, this);
        documentDao = new DocumentDao(documentDaoConfig, this);
        placeCodeDao = new PlaceCodeDao(placeCodeDaoConfig, this);
        placeDao = new PlaceDao(placeDaoConfig, this);
        dateDao = new DateDao(dateDaoConfig, this);
        roleCodeDao = new RoleCodeDao(roleCodeDaoConfig, this);
        personRoleCodeDao = new PersonRoleCodeDao(personRoleCodeDaoConfig, this);
        personEventDao = new PersonEventDao(personEventDaoConfig, this);
        personDocumentDao = new PersonDocumentDao(personDocumentDaoConfig, this);
        eventDocumentDao = new EventDocumentDao(eventDocumentDaoConfig, this);
        eventPlaceDao = new EventPlaceDao(eventPlaceDaoConfig, this);
        eventDateDao = new EventDateDao(eventDateDaoConfig, this);
        eventStringDao = new EventStringDao(eventStringDaoConfig, this);
        documentPlaceDao = new DocumentPlaceDao(documentPlaceDaoConfig, this);

        registerDao(Person.class, personDao);
        registerDao(EventCode.class, eventCodeDao);
        registerDao(Event.class, eventDao);
        registerDao(EventAttribute.class, eventAttributeDao);
        registerDao(Document.class, documentDao);
        registerDao(PlaceCode.class, placeCodeDao);
        registerDao(Place.class, placeDao);
        registerDao(Date.class, dateDao);
        registerDao(RoleCode.class, roleCodeDao);
        registerDao(PersonRoleCode.class, personRoleCodeDao);
        registerDao(PersonEvent.class, personEventDao);
        registerDao(PersonDocument.class, personDocumentDao);
        registerDao(EventDocument.class, eventDocumentDao);
        registerDao(EventPlace.class, eventPlaceDao);
        registerDao(EventDate.class, eventDateDao);
        registerDao(EventString.class, eventStringDao);
        registerDao(DocumentPlace.class, documentPlaceDao);
    }
    
    public void clear() {
        personDaoConfig.getIdentityScope().clear();
        eventCodeDaoConfig.getIdentityScope().clear();
        eventDaoConfig.getIdentityScope().clear();
        eventAttributeDaoConfig.getIdentityScope().clear();
        documentDaoConfig.getIdentityScope().clear();
        placeCodeDaoConfig.getIdentityScope().clear();
        placeDaoConfig.getIdentityScope().clear();
        dateDaoConfig.getIdentityScope().clear();
        roleCodeDaoConfig.getIdentityScope().clear();
        personRoleCodeDaoConfig.getIdentityScope().clear();
        personEventDaoConfig.getIdentityScope().clear();
        personDocumentDaoConfig.getIdentityScope().clear();
        eventDocumentDaoConfig.getIdentityScope().clear();
        eventPlaceDaoConfig.getIdentityScope().clear();
        eventDateDaoConfig.getIdentityScope().clear();
        eventStringDaoConfig.getIdentityScope().clear();
        documentPlaceDaoConfig.getIdentityScope().clear();
    }

    public PersonDao getPersonDao() {
        return personDao;
    }

    public EventCodeDao getEventCodeDao() {
        return eventCodeDao;
    }

    public EventDao getEventDao() {
        return eventDao;
    }

    public EventAttributeDao getEventAttributeDao() {
        return eventAttributeDao;
    }

    public DocumentDao getDocumentDao() {
        return documentDao;
    }

    public PlaceCodeDao getPlaceCodeDao() {
        return placeCodeDao;
    }

    public PlaceDao getPlaceDao() {
        return placeDao;
    }

    public DateDao getDateDao() {
        return dateDao;
    }

    public RoleCodeDao getRoleCodeDao() {
        return roleCodeDao;
    }

    public PersonRoleCodeDao getPersonRoleCodeDao() {
        return personRoleCodeDao;
    }

    public PersonEventDao getPersonEventDao() {
        return personEventDao;
    }

    public PersonDocumentDao getPersonDocumentDao() {
        return personDocumentDao;
    }

    public EventDocumentDao getEventDocumentDao() {
        return eventDocumentDao;
    }

    public EventPlaceDao getEventPlaceDao() {
        return eventPlaceDao;
    }

    public EventDateDao getEventDateDao() {
        return eventDateDao;
    }

    public EventStringDao getEventStringDao() {
        return eventStringDao;
    }

    public DocumentPlaceDao getDocumentPlaceDao() {
        return documentPlaceDao;
    }

}
